define(function(require, exports, module) {
	"use strict";

	var baseService = require('Base_Service');
	// 控制器名
	exports.controller = "Trains";
	
	/* 学时商品列表 */
	exports.getTrainGoods = function(currpage, pageSize, success) {
		var data = {
			pageIndex: currpage,
			pageSize: pageSize
		};
		return baseService.post(
			baseService.getApiUrl(exports.controller, "Select"),
			data,
			function(retval) {
				success && success(retval);
			}
		);
	};
	
	/* 学时 */
	exports.add = function(data,success) {
		return baseService.post(
			baseService.getApiUrl(exports.controller, "Add"),
			data,
			function(retval) {
				success && success(retval);
			}
		);
	};
	
	/* 学时记录 */
	exports.getTrains = function(currpage, pageSize, success) {
		var data = {
			pageIndex: currpage,
			pageSize: pageSize
		};
		return baseService.post(
			baseService.getApiUrl(exports.controller, "List"),
			data,
			function(retval) {
				success && success(retval);
			}
		);
	};
	
	/* 学时详情 */
	exports.getTrain = function(id, success) {
		var data = "id="+id;
		return baseService.get(
			baseService.getApiUrl(exports.controller, "Detail"),
			data,
			function(retval) {
				success && success(retval);
			}
		);
	};
	
});